package com.jyx.manage_cms.service;

import com.jyx.framework.domain.system.SysDictionary;
import com.jyx.framework.exception.ExceptionCast;
import com.jyx.framework.model.response.CommonCode;

import com.jyx.manage_cms.dao.SysDictionaryRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class SysDictionaryService {

    @Autowired
    SysDictionaryRepository sysDictionaryRepository;

    public SysDictionary getDicByType(String dType) {
        SysDictionary sysDictionary = sysDictionaryRepository.findByDType(dType);
        if(sysDictionary==null){
            ExceptionCast.cast(CommonCode.INVALID_PARAM);
        }
        return sysDictionary;
    }
}
